package com.voice.server.message.device;

import lombok.Getter;
import lombok.Setter;
import org.springframework.util.FileCopyUtils;

import java.io.IOException;
import java.io.InputStream;

@Getter
@Setter
public class FileMessage {

    public String topic="device_file";
    private byte[] content;

    public FileMessage(){}

    public FileMessage(byte[] content){
        this.content=content;
    }

    public FileMessage(InputStream inputStream) throws IOException {
        this.content = FileCopyUtils.copyToByteArray(inputStream);
    }

}
